package com.lx.boot.canal;

import com.lx.annotation.Note;
import com.lx.boot.config.annotation.Properties;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Data
@ConfigurationProperties(prefix = "server.canal")
public class CanalProperties {

    @Note("是否开启canal")
    private boolean enable;

    @Note("canal的IP地址")
    @NotBlank(message = "canal的IP地址不能为空!")
    private String ip;

    @Note("canal的端口")
    private int prot = 11111;

    @Note("canal服务端的服务名称")
    @NotBlank(message = "canal服务端的服务名称不能为空!")
    private String destination="example";

    @Note("canal的用户名")
    private String username;

    @Note("canal的密码")
    private String password;

    @Note("需要监听的表")
    @NotBlank(message = "需要监听的表信息不能为空!")
    private String subscribe;
}
